#pragma once

#pragma comment(lib, "fmodex_vc.lib")

#include "Singleton.h"
#include "fmod.hpp"
#include "fmod_errors.h"

typedef std::map<char*, FMOD::Sound*>	soundData;

enum
{
	BGM_MODE,
	EFFECT_MODE,
};

class GTAFmodEX : public Singleton<GTAFmodEX>
{
private:
	friend class Singleton<GTAFmodEX>;

protected:
	GTAFmodEX(void);
	virtual ~GTAFmodEX(void);

private:
	void _ShutDown(void);

private:
	bool _ErrCheckFmodEX(FMOD_RESULT& result);
	bool _KeyCheck(char *name)
	{
		return mSound.find(name) != mSound.end();
	}

public:
	bool InitFmodEX(void);
	bool CreateSound(char* name, char* path, int mode);
	void PlaySound(char* name, float volume);

private:
	FMOD::System*	mSystem;
	FMOD::Channel*	mChannel;
	FMOD_RESULT		mResult;
	UINT			mVersion;

	soundData mSound;
};
